<template>
	<view>
		
	
		<view class="flex-column-center" >
			<view v-for="(item,index) in list" :key="index">
				<view  class="item1 ">
					<view class="flex-row-space-between">
						
					
					<view class="">
						<view class="itemTitle">
							弘川钱包
						</view>
						<view class="flex-row-flex-start" style="margin-top: 20rpx;">
							<view class="itemTitle1">
								{{item.price}}
							</view>
							<view class="itemTitle2">
								全部待还(元)
							</view>
						</view>
						<view class="time">
							还款日期：{{item.hk_time}}
						</view>
					</view>
					<view  class="itemButton flex-row-center">
						{{item.order_status}}
					</view>
					<!-- <view v-if='Number(item.status)==4||Number(item.status)==6'  class="flex-row-center itemButton">
						联系客服
					</view>
					<view v-if='Number(item.status)==6' class="itemButton2 flex-row-center">
						已逾期
					</view>
					<view v-if='Number(item.status)==5' @click="toUrl('/pages/index/service1')" class="flex-row-center itemButton1">
						还款成功
					</view> -->
					</view>
					<view v-if='Number(item.whitewhale_status)==0' class=" flex-row-space-between">
					
						<view class="topTitle">
							您需要完成授权，秒下款
						</view>
						<view @click="qusouquan(item.url)"  class="itemButton3 flex-row-center">
							去授权
						</view>
					</view>
				</view>
				
			</view>
		
		</view>

	
		 <view v-if='!list.length' class="flex-column-center">
			<image class="empty" src="/static/repayment/empty.png" mode=""></image>
			<view class="title">
				你现在还没有要还的款项哦～
			</view>
			<view @click="toUrl('/pages/index/improveInfo')" class="button flex-column-center">
				马上申请
			</view>
		</view>
		
		
	
		<view v-if='list.length' class="">
			<view v-if='Number(list[0].status)==5' @click='bottomButtonClick()' class="fixed-bottom footer">
				<view  class="bottomButton flex-column-center" style="margin-bottom: 140rpx;">
					申请提额再借一笔
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import {
		mapActions,
		mapState
	} from "vuex";
	import {
		orderList,
	} from '@/api/index.js'
	export default {
		components: {},
		computed: {

		},
		data() {
			return {
				list:[],
				data:{}

			}
		},
		computed: {
			...mapState([
				'baseColor'
			]),
		},
		onShow() {
		this.loadData()
		},
		onLoad(e) {
			
		},
		//下拉刷新
		onPullDownRefresh() {


		},
		//加载更多
		onReachBottom() {

		},
		onPageScroll(e) {
			// if (e.scrollTop > 20) {
			// 	this.backgroundColor = "#FBF9FF"
			// } else {
			// 	this.backgroundColor = "#ffffff00"
			// }
		},
		methods: {
			qusouquan(url){
				// #ifdef H5
				
				window.location.href = url; 
				// #endif
				
				// #ifdef APP
				plus.runtime.openURL(url); 
				
				// #endif
			},
			loadData () {
			
				var data = {
				type:2,
				}
				orderList(data).then(res => {
					this.list=res.data
				})
			},
			
			showToast(title) {
				uni.showToast({
					title: title,
					icon: 'none'
				})
			},
			toUrl(url) {
				uni.navigateTo({
					url: url
				})
			},
		}
	}
</script>

<style lang="scss">
.empty{
	margin-top: 157px;
	width: 386rpx;
	height: 222rpx;
}
.title{
	margin-top: 40rpx;
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 28rpx;
	color: #999999;
}
.button{
	margin-top: 60rpx;
	width: 424rpx;
	height: 84rpx;
	background: linear-gradient( 90deg, #2366E6 0%, #4373F6 100%);
	border-radius: 16rpx 16rpx 16rpx 16rpx;
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 32rpx;
	color: #FFFFFF;
}
.topView{
	padding: 30rpx 30rpx;
	// height: 64rpx;
	background: rgba(35,102,230,0.1);
	border-radius: 0rpx 0rpx 0rpx 0rpx;
}
.warn{
	margin-right: 4rpx;
	width: 32rpx;
	height: 32rpx;
}
.topTitle{
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 26rpx;
	color: red;
}
.item1{
	
	padding: 28rpx;
	// margin: 20rpx 20rpx;
	margin-top: 20rpx;
	width: 670rpx;
	// height: 256rpx;
	background-image:url('../../static/repayment/bg.png');
	background-size: 100% 100%;
}
.itemTitle{
	font-family: PingFang SC, PingFang SC;
	font-weight: 700;
	font-size: 34rpx;
	color: #16171B;
}
.itemButton{
	width: 170rpx;
	height: 56rpx;
	background: linear-gradient( 90deg, #2366E6 0%, #4373F6 100%);
	border-radius: 40rpx 40rpx 40rpx 40rpx;
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 28rpx;
	color: #FFFFFF;
}
.itemButton1{
	width: 170rpx;
	height: 56rpx;
	background: linear-gradient( 90deg, #399B50 0%, #75C58C 100%);
	border-radius: 40rpx 40rpx 40rpx 40rpx;
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 28rpx;
	color: #FFFFFF;
}
.itemButton3{
	width: 170rpx;
	height: 56rpx;
	background:red;
	border-radius: 40rpx 40rpx 40rpx 40rpx;
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 28rpx;
	color: #FFFFFF;
}
.itemTitle1{
	font-family: DIN Alternate, DIN Alternate;
	font-weight: 700;
	font-size: 64rpx;
	color: #16171B;
}
.itemTitle2{
	margin-top: 10rpx;
	margin-left: 10rpx;
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 24rpx;
	color: #16171B;
}
.time{
	margin-top: 12rpx;
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 26rpx;
	color: #999999;
}
.itemButton2{
	margin-top: -60rpx;
	margin-left: -140rpx;
	width: 64rpx;
	height: 28rpx;
	background: #EC554F;
	border-radius: 40rpx 40rpx 40rpx 40rpx;
	font-family: PingFang SC, PingFang SC;
	font-weight: 400;
	font-size: 16rpx;
	color: #FFFFFF;
}
</style>